import os

def path_check(path):
    path_list = path.split('/')

    base_path = ''
    for path_part in path_list:
        base_path = os.path.join(base_path, path_part + '/')

        if not os.path.exists(base_path):
            os.mkdir(base_path)

    return path